package com.cheejee.goodscenter.service;

import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.springframework.validation.annotation.Validated;

import com.cheejee.goodscenter.module.entity.GoodsCustomProperties;
import com.github.pagehelper.Page;

/**
 * @author CARRY
 * @Date 2020年10月28日上午1:49:47
 */
@Validated
public interface GoodsCustomPropertiesService {

	/**
	 *按条件查询商品自定义属性
	 *
	 * @param goodsId 商品id
	 * @param propertiesName 属性名称
	 * @return
	 */
	Page<GoodsCustomProperties> queryGoodsCustomProperties(Long goodsId, String propertiesName, int pageNum, int pageSize);
	
	GoodsCustomProperties queryGoodsCustomPropertiesById(@NotNull(message = "商品自定义属性ID不能为空")Long id);
	
	int addGoodsCustomProperties(GoodsCustomProperties properties);
	
	int addGoodsCustomProperties(List<GoodsCustomProperties> properties);

	int changeGoodsCustomProperties(GoodsCustomProperties properties);
	
	/**
	 * 修改商品自定义属性，没有商品自定义属性需要传空集，不能使用NULL
	 *
	 * @param goodsId
	 * @param properties
	 * @return 添加的屬性數量
	 */
	int changeGoodsCustomProperties(Long goodsId, List<GoodsCustomProperties> properties);
	
	int deleteGoodsCustomProperties(@NotEmpty(message = "删除的商品自定义属性不能为空") Long...id);
	
}
